<template>
	<view class="page"  :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
		<c-nav-bar :title="titleHeader" ></c-nav-bar>
		<!-- 在线投诉 -->
		<view class="zxts">
			<view class="top">
				<view class="left">在线投诉</view>
				<view class="right" @tap="toReacords">
					<text>投诉记录</text>
					<image src="@/static/my/complaintFeedback/icon_yjt.png"></image>
				</view>
			</view>
			<view class="box1" @tap="toComplain">
				<image class="bg" src="https://i.ringzle.com/file/20231030/b3de587a1e854ffe9cb6ba7644483e63.png">
				</image>
				<view class="text">
					<text>在线投诉</text>
					<text>快捷投诉</text>
				</view>
				<image class="rimg" src="https://i.ringzle.com/file/20240110/bfba24e4a4ae4e79b5dd395a0f9e7aa8.png"></image>
			</view>
		</view>
		<!-- 电话投诉 -->
		<view class="dhts">
			<view class="top">电话投诉</view>
			<view class="box1" v-for="(item,index) in complainList1" :key="index" @tap="toCallPhone(item.phone)">
				<image class="bg" :src="item.bg"></image>
				<view class="text">
					<text>{{item.title}}</text>
					<text>{{item.phone}}</text>
				</view>
				<image class="rimg" :src="item.img"></image>
			</view>
			<view class="phones">
				<view :class="item.class" v-for="(item,index) in complainList2" :key="index"
					@tap="toCallPhone(item.phone)">
					<view class="text">{{item.title}}</view>
					<image class="rimg" :src="item.img"></image>
				</view>
			</view>
		</view>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		name: 'complaintFeedbackIndex',
		data() {
			return {
				titleHeader:'投诉反馈',
				h:uni.getSystemInfoSync().windowHeight - 87,
				mt: uni.getSystemInfoSync().statusBarHeight + 44,
				complainList1: [{
						bg: 'https://i.ringzle.com/file/20231030/a4739a474ec742938f71f7f51d2b240e.png',
						img: 'https://i.ringzle.com/file/20240110/6796a5bfe24047dcaa714e82fa804a8a.png',
						title: '政府服务热线',
						phone: '12345'
					},
					{
						bg: 'https://i.ringzle.com/file/20231107/954d5169ecb244ba953684ce5a13e0e8.png',
						img: 'https://i.ringzle.com/file/20240110/c4cefbc1e5f7466f8461213f0ad44b6e.png',
						title: '消费者投诉举报热线',
						phone: '12315'
					},
					{
						bg: 'https://i.ringzle.com/file/20231107/b56b58e04daf4300a9cd23b398e742ba.png',
						img: 'https://i.ringzle.com/file/20240110/cb704b929803415e9fb279614c377b95.png',
						title: '物价举报热线',
						phone: '12358'
					}
				],
				complainList2: [{
						class: 'bgc_blue',
						img: 'https://i.ringzle.com/file/20240110/6796a5bfe24047dcaa714e82fa804a8a.png',
						title: '报警110',
						phone: '110'
					},
					{
						class: 'bgc_green',
						img: 'https://i.ringzle.com/file/20240110/c4cefbc1e5f7466f8461213f0ad44b6e.png',
						title: '急救120',
						phone: '120'
					},
					{
						class: 'bgc_orange',
						img: 'https://i.ringzle.com/file/20240110/ae913cbb10f14d22b540756612fe46f9.png',
						title: '火警119',
						phone: '119'
					},
					{
						class: 'bgc_cyan',
						img: 'https://i.ringzle.com/file/20240110/6796a5bfe24047dcaa714e82fa804a8a.png',
						title: '交警122',
						phone: '122'
					}
				]
			}
		},
		methods: {
			toCallPhone(phone) {
				uni.makePhoneCall({
					phoneNumber: phone
				})
			},
			toReacords() {
				uni.navigateTo({
					url: '/pagesMy/complaintFeedback/dataList'
				})

			},
			toComplain() {
				// return this.$refs.uToast.show({
				// 	type:'success',
				// 	title:'',
				// 	message: "正在开发",
				// 	iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/default.png'
				// }) 

				uni.navigateTo({
					url: '/pagesMy/complaintFeedback/complain'
				})
			}
		}
	}
</script>

<style scoped lang="less">
	.page {
		padding: 30rpx 24rpx;
		// padding-top: ;

		.zxts {
			.top {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.left {
					font-size: 36rpx;
					font-family: PingFang-SC-Bold, PingFang-SC;
					font-weight: bold;
					color: #333333;
					line-height: 36rpx;
				}

				.right {
					display: flex;
					justify-content: flex-end;
					align-items: center;

					text {
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #007A69;
						line-height: 24rpx;
					}

					image {
						width: 24rpx;
						height: 24rpx;
						margin-left: 10rpx;
					}
				}
			}

			.box1 {
				margin-top: 36rpx;
			}
		}

		.dhts {
			margin-top: 64rpx;

			.top {
				font-size: 36rpx;
				font-family: PingFang-SC-Bold, PingFang-SC;
				font-weight: bold;
				color: #333333;
				line-height: 36rpx;
				margin-bottom: 36rpx;
			}

			.box1 {
				margin-bottom: 20rpx;
			}

			.phones {
				display: flex;
				justify-content: space-between;
				flex-wrap: wrap;

				&>view {
					width: calc(50% - 12rpx);
					height: 168rpx;
					border-radius: 20rpx;
					margin-top: 20rpx;
					display: flex;
					align-items: center;
					justify-content: space-between;

					.text {
						font-size: 36rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 600;
						color: #FFFFFF;
						text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.21);
						margin-left: 40rpx;
					}

					.rimg {
						width: 80rpx;
						height: 80rpx;
						margin-right: 40rpx;
					}
				}

				.bgc_blue {
					background: linear-gradient(to right, #2181fe, #24b2ff);
				}

				.bgc_green {
					background: linear-gradient(to right, #21D0A3, #55E8A8);
				}

				.bgc_orange {
					background: linear-gradient(to right, #FF8652, #FFB647);
				}

				.bgc_cyan {
					background: linear-gradient(to right, #0EBFFE, #00D3E8);
				}
			}
		}

		.box1 {
			width: 100%;
			height: 168rpx;
			border-radius: 20rpx;
			position: relative;

			.bg {
				position: absolute;
				left: 0;
				top: 0;
				width: 100%;
				height: 100%;
				z-index: -1;
			}

			.text {
				padding-left: 40rpx;
				float: left;

				text {
					display: flex;
					flex-direction: column;

					&:first-child {
						font-size: 36rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 600;
						color: #FFFFFF;
						text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.21);
						margin-top: 40rpx;
					}

					&:last-child {
						font-size: 24rpx;
						font-family: PingFang-SC-Bold, PingFang-SC;
						font-weight: bold;
						color: #FFFFFF;
						margin-top: 20rpx;
					}
				}
			}

			.rimg {
				float: right;
				width: 96rpx;
				height: 96rpx;
				margin: 36rpx 48rpx 0 0;
			}
		}
	}
</style>